from time import sleep

from selenium import webdriver

class BasePage:
    def __init__(self, browser_type):
        self.driver = browser_type
    # 打开页面
    def open(self):
        self.driver.get(self.url)
    # 点击
    def click(self, loc):
        self.driver.find_element(*loc).click()
    # 输入
    def input(self, loc, context):
        self.driver.find_element(*loc).send_keys(context)
    # 等待
    def wait(self, time = 1):
        sleep(time)
    # 关闭页面
    def quit(self):
        self.driver.quit()
